import type { ServerInfo } from '@/api/model/serverModel';
import { request } from '@/utils/request';

const Api = {
  Servers: '/proxy/servers',
  Restart: '/proxy/restart',
  Stop: '/proxy/stop',
};

export function getServers() {
  return request.get<Array<ServerInfo>>({
    url: Api.Servers,
  });
}

export function restartServer(name: string) {
  return request.get({
    url: `${Api.Restart}?name=${name}`,
  });
}

export function stopServer(name: string) {
  return request.get({
    url: `${Api.Stop}?name=${name}`,
  });
}
